package org.zoomdev.zoom.aop.impl;

import org.zoomdev.zoom.aop.Interceptor;
import org.zoomdev.zoom.aop.InterceptorFactory;

import java.lang.reflect.Method;
import java.util.List;

public abstract class SingleInterceptorFactory implements InterceptorFactory {
    @Override
    public void createInterceptors(Class<?> targetClass, Method method, List<Interceptor> interceptors) {
        Interceptor interceptor = createInterceptor(targetClass, method);
        if (interceptor != null) {
            interceptors.add(interceptor);
        }
    }

    protected abstract Interceptor createInterceptor(Class<?> targetClass, Method method);


}
